﻿using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Layout;

namespace StarWarsSagaCreator
{
    class AbilityBox : GroupBox
    {
        //private Label strLabel;
        public Label StrLabel { get; set; }
        //private TextBox strScore;
        public TextBox StrScore { get; set; }
        //private Label strMod;
        public Label StrMod { get; set; }
        //private Label dexLabel;
        public Label DexLabel { get; set; }
        //private TextBox dexScore;
        public TextBox DexScore { get; set; }
        //private Label dexMod;
        public Label DexMod { get; set; }
        //private Label conLabel;
        public Label ConLabel { get; set; }
        //private TextBox conScore;
        public TextBox ConScore { get; set; }
        //private Label conMod;
        public Label ConMod { get; set; }
        //private Label intLabel;
        public Label IntLabel { get; set; }
        //private TextBox intScore;
        public TextBox IntScore { get; set; }
        //private Label intMod;
        public Label IntMod { get; set; }
        //private Label wisLabel;
        public Label WisLabel { get; set; }
        //private TextBox wisScore;
        public TextBox WisScore { get; set; }
        //private Label wisMod;
        public Label WisMod { get; set; }
        //private Label chaLabel;
        public Label ChaLabel { get; set; }
        //private TextBox chaScore;
        public TextBox ChaScore { get; set; }
        //private Label chaMod;
        public Label ChaMod { get; set; }
        private Label labelLabel;

        public AbilityBox()
        {
            //Size = new Size(140, 200);
            AutoSize = true;
            labelLabel = new Label { Location = new Point(5, 10), Size = new Size(130, 15), Text = "  Score    Ability     Mod"};
            StrScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 28), Size = new Size(45, 25), Text = "1", Name = "strScore", TabIndex = 9, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            StrLabel = new Label { Location = new Point(48, 28), Size = new Size(40, 25), Text = "STR", Name = "STR", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            StrMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 28), Size = new Size(45, 25), Text = "0", Name = "strMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };
            DexScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 56), Size = new Size(45, 25), Text = "1", Name = "dexScore", TabIndex = 10, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            DexLabel = new Label { Location = new Point(48, 56), Size = new Size(40, 25), Text = "DEX", Name = "DEX", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            DexMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 56), Size = new Size(45, 25), Text = "0", Name = "dexMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };
            ConScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 84), Size = new Size(45, 25), Text = "1", Name = "conScore", TabIndex = 11, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            ConLabel = new Label { Location = new Point(48, 84), Size = new Size(40, 25), Text = "CON", Name = "CON", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            ConMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 84), Size = new Size(45, 25), Text = "0", Name = "conMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };
            IntScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 112), Size = new Size(45, 25), Text = "1", Name = "intScore", TabIndex = 12, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            IntLabel = new Label { Location = new Point(48, 112), Size = new Size(40, 25), Text = "INT", Name = "INT", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            IntMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 112), Size = new Size(45, 25), Text = "0", Name = "intMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };
            WisScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 140), Size = new Size(45, 25), Text = "1", Name = "wisScore", TabIndex = 13, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            WisLabel = new Label { Location = new Point(48, 140), Size = new Size(40, 25), Text = "WIS", Name = "WIS", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            WisMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 140), Size = new Size(45, 25), Text = "0", Name = "wisMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };
            ChaScore = new TextBox { TextAlign = HorizontalAlignment.Center, Location = new Point(5, 168), Size = new Size(45, 25), Text = "1", Name = "chaScore", TabIndex = 14, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            ChaLabel = new Label { Location = new Point(48, 168), Size = new Size(40, 25), Text = "CHA", Name = "CHA", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold), AutoSize = false };
            ChaMod = new Label { TextAlign = ContentAlignment.MiddleCenter, Location = new Point(86, 168), Size = new Size(45, 25), Text = "0", Name = "chaMod", TabStop = false, Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Bold)/*, BorderStyle = BorderStyle.Fixed3D*/, AutoSize = false };

            Controls.Add(labelLabel);
            Controls.Add(StrScore);
            Controls.Add(StrLabel);
            Controls.Add(StrMod);
            Controls.Add(DexScore);
            Controls.Add(DexLabel);
            Controls.Add(DexMod);
            Controls.Add(ConScore);
            Controls.Add(ConLabel);
            Controls.Add(ConMod);
            Controls.Add(IntScore);
            Controls.Add(IntLabel);
            Controls.Add(IntMod);
            Controls.Add(WisScore);
            Controls.Add(WisLabel);
            Controls.Add(WisMod);
            Controls.Add(ChaScore);
            Controls.Add(ChaLabel);
            Controls.Add(ChaMod);
        }

        public override sealed bool AutoSize
        {
            get { return base.AutoSize; }
            set { base.AutoSize = value; }
        }

        //private LayoutEngine _layoutEngine;

        //public override LayoutEngine LayoutEngine
        //{
        //    get
        //    {
        //        if (_layoutEngine == null) _layoutEngine = new CustomLayoutEngine();
        //        return _layoutEngine;
        //    }
        //}

        //public override Size GetPreferredSize(Size proposedSize)
        //{
        //    Size size = base.GetPreferredSize(proposedSize);

        //    foreach (Control control in Controls)
        //    {
        //        int newHeight = control.Height + control.Margin.Vertical + Padding.Vertical;
        //        if (newHeight > size.Height) size.Height = newHeight;
        //    }

        //    return size;
        //}
    }
}
